<?php
    // Send Header
    $xls->setHeader('Reporte_'.date('Y_m_d').'.xls');

    // XLS Data Cell
    $xls->BOF();
    $xls->writeLabel(1,0,"VENETEL");
    $xls->writeLabel(2,0,"Reporte de Precios : ");

    $xls->writeLabel(4,0,"ID");
    $xls->writeLabel(4,1,"Servicio");
    $xls->writeLabel(4,2,"Fecha de Actualizacion");
	$xls->writeLabel(4,3,"Entregable");
	$xls->writeLabel(4,4,"Precio");

	$x = 5;
	$y = 0;

	foreach ($precios as $precio){
    $xls->writeLabel($x, $y++, $precio['Precio']['id']);
    $xls->writeLabel($x, $y++, $precio['Servicio']['nm_servicio'], array('controller' => 'servicios', 'action' => 'view', $precio['Servicio']['id']));
    $xls->writeLabel($x, $y++, $precio['Precio']['fl_actualiza']);
	$xls->writeLabel($x, $y++, $precio['Entregable']['nm_entregable'], array('controller' => 'entregables', 'action' => 'view', $precio['Entregable']['id']));
	$xls->writeLabel($x, $y++, $precio['Precio']['precio']);
	$x++;
		if($y === 5) {
			$y = 0;
		}
	}

    $xls->EOF();
    exit();
?>